#pragma once

#include "base_type.h"
#include "pe.h"

/*
 * Check the current file is opened correctly.
 *
 * Returns:
 *   TRUE if the file is opened and contents are read,
 *   otherwise FALSE.
 */
BOOL check_file_opened(void);

/*
 * Get the file name (excludes directory) of the crrently opened file.
 *
 * Returns:
 *   Pointer to the null-terminated file title.
 */
str_wc get_cur_file_title(void);

/*
 * Execute command for open file.
 *
 * Parameters:
 *   path - Path of the file to open.
 *   p_pe - (Out) Pointer to the pe_file structure to read.
 */
void exec_open(str_wc path, pe_file *p_pe);

/*
 * Execute command for re-open the current file.
 *
 * Parameters:
 *   p_pe - (Out) Pointer to the pe_file structure to read.
 */
void exec_refresh(pe_file *p_pe);

/*
 * Execute command to show current file.
 */
void exec_file(void);

/*
 * Execute command to dump file data.
 *
 * Parameters:
 *   start - Start of the range to dump.
 *   len   - Length of the range to dump.
 */
void exec_dump_data(size_t start, size_t len);

void exec_rva(pe_file *p_pe, size_t rva);
void exec_offset(pe_file *p_pe, size_t offset);
